package user_center.menu.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import user_center.menu.pojo.SystemMenu;
import user_center.menu.pojo.SystemMenuRole;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author Ezio.Auditore
 * @since 2022-07-20
 */
public interface SystemMenuMapper extends BaseMapper<SystemMenu> {

    /**
     * 根据角色查找菜单列表
     * @param roleId
     * @return
     */
    @Select("select * from system_menu_role r,system_menu m where m.id = r.menu_id and role_id = #{roleId}")
    List<SystemMenuRole> getMenuRoleList(@Param("roleId") Integer roleId);

}
